<?php
defined('IN_APP') or die('Access Denied');
//无Memcached扩展环境下测试使用
class Memcached
{
    const OPT_BINARY_PROTOCOL = 1;
    const OPT_CACHE_LOOKUPS = 2;
    const RES_NOTFOUND = 3;
    const RES_SUCCESS = 4;

    private $resultCode;
    private $resultMsg;

    public function __construct($id = "")
    {}
    public function addServer($host, $port)
    {
        return true;
    }
    public function setOption($name, $value)
    {}
    public function setOptions(array $arr)
    {}
    public function set($name, $value, $expiration = 0)
    {}
    public function get($key)
    {
        $this->resultCode = Memcached::RES_NOTFOUND;
        $this->resultMsg = 'skip memcached';
        return false;
    }
    public function getResultCode()
    {
        return $this->resultCode;
    }
    public function getResultMessage()
    {
        return $this->resultMsg;
    }
}